package com.zeroone.star.publish.controller;

import com.zeroone.star.project.dto.notify.SampleNotifyDTO;
import com.zeroone.star.project.vo.JsonVO;
import com.zeroone.star.publish.comp.RmPublish;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description 测试消息发布控制器
 * @Author lyx
 * @since 2024/11/8 21:54
 */

@RestController
@Api(tags = "rocketmq")
public class RmController {
    @Resource
    RmPublish publish;

    @ApiOperation("发布消息")
    @PostMapping("publish")
    public JsonVO<String> publish(SampleNotifyDTO message){
        publish.publishNotify(message);
        return JsonVO.success("消息发布成功");
    }
}
